class ProductData {
  int? id;
  String? name;
  String? nameEn;
  int? lastNum;
  String? price;
  int? technicalFee;
  int? period;
  double? savePower;
  int? num;
  int? startTimeType;
  String? publisherName;
  String? publisherNameEn;
  double? yearIncomeRate;
  double? pledge;
  int? pledgeType;

  ProductData({
    this.id,
    this.name,
    this.nameEn,
    this.lastNum,
    this.price,
    this.technicalFee,
    this.period,
    this.savePower,
    this.num,
    this.startTimeType,
    this.publisherName,
    this.publisherNameEn,
    this.yearIncomeRate,
    this.pledge,
    this.pledgeType,
  });

  factory ProductData.fromJson(Map<String, dynamic> json) => ProductData(
        id: json['id'] as int?,
        name: json['name'] as String?,
        nameEn: json['nameEn'] as String?,
        lastNum: json['lastNum'] as int?,
        price: (json['price'])?.toString(),
        technicalFee: json['technicalFee'] as int?,
        period: json['period'] as int?,
        savePower: (json['savePower'])?.toDouble(),
        num: json['num'] as int?,
        startTimeType: json['startTimeType'] as int?,
        publisherName: json['publisherName'] as String?,
        publisherNameEn: json['publisherNameEn'] as String?,
        yearIncomeRate: (json['yearIncomeRate'])?.toDouble(),
        pledge: (json['pledge'])?.toDouble(),
        pledgeType: json['pledgeType'] as int?,
      );

  Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'nameEn': nameEn,
        'lastNum': lastNum,
        'price': price,
        'technicalFee': technicalFee,
        'period': period,
        'savePower': savePower,
        'num': num,
        'startTimeType': startTimeType,
        'publisherName': publisherName,
        'publisherNameEn': publisherNameEn,
        'yearIncomeRate': yearIncomeRate,
        'pledge': pledge,
        'pledgeType': pledgeType,
      };
}
